package com.codeplay.repository;

import com.codeplay.entity.LearningProgress;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface LearningProgressRepository extends JpaRepository<LearningProgress, Long> {
    List<LearningProgress> findByUserIdAndCourseId(Long userId, Long courseId);
    Optional<LearningProgress> findByUserIdAndContentId(Long userId, Long contentId);
    List<LearningProgress> findByUserIdAndChapterId(Long userId, Long chapterId);
    long countByUserIdAndCourseIdAndStatus(Long userId, Long courseId, LearningProgress.ProgressStatus status);
} 